<template>
  <view class="movie-boom">
    <!-- 1 -->
    <view class="movie-boom-item" @click="getindex" v-if="status == 1">
      <image
        src="https://picture-1326598115.cos.ap-nanjing.myqcloud.com/2025/06/16dbe06f0983e74e8fadd8b9def817d269工作台.png"
        class="boom-item-image"
      ></image>
      <view class="boom-item-text" style="color: #ff6000">首页</view>
    </view>
    <view class="movie-boom-item" @click="getindex" v-else>
      <image
        class="boom-item-image"
        src="https://picture-1326598115.cos.ap-nanjing.myqcloud.com/2025/06/11fc97dd7e0a8f4e099e9afcca9bf87176微信图片2_20250611111012.png"
      ></image>
      <view class="boom-item-text">首页</view>
    </view>
    <!-- 2 -->
    <view class="movie-boom-item" @click="getorder" v-if="status == 2">
      <image
        src="https://picture-1326598115.cos.ap-nanjing.myqcloud.com/2025/06/16c2cce77ddb544c0d86a619ee7dd9f240完成.png"
        class="boom-item-image"
      ></image>
      <view class="boom-item-text" style="color: #ff6000">订单</view>
    </view>
    <view class="movie-boom-item" @click="getorder" v-else>
      <image
        src="https://picture-1326598115.cos.ap-nanjing.myqcloud.com/2025/06/1160586cad05d649a39af1caf83eeafb47微信图片5_20250611111136.png"
        class="boom-item-image"
      ></image>
      <view class="boom-item-text">订单</view>
    </view>
    <!-- 3 -->
    <view class="movie-boom-item" @click="getshoop" v-if="status == 3">
      <image
        src="https://picture-1326598115.cos.ap-nanjing.myqcloud.com/2025/06/160835e3e1611748348dabdefae5a09a38商品 (2).png"
        class="boom-item-image"
      ></image>
      <view class="boom-item-text" style="color: #ff6000">商品</view>
    </view>
    <view class="movie-boom-item" @click="getshoop" v-else>
      <image
        src="https://picture-1326598115.cos.ap-nanjing.myqcloud.com/2025/06/1140a15aba97de4d17aa1493328b3374d0微信图片4_20250611111111.png"
        class="boom-item-image"
      ></image>
      <view class="boom-item-text">商品</view>
    </view>
  </view>
</template>

<script setup>
import { ref, onMounted } from "vue";

const props = defineProps({
  type: {
    type: Number,
    default: 1,
  },
});

const status = ref();

onMounted(() => {
  console.log("传入的 type 值:", props.type);
  status.value = props.type;
});

const getindex = () => {
  uni.redirectTo({
    url: "/pages/shoopbackground/index",
  });
};
const getshoop = () => {
  uni.redirectTo({
    url: "/pages/shoopbackground/shoop",
  });
};
const getorder = () => {
  uni.redirectTo({
    url: "/pages/shoopbackground/orders",
  });
};
</script>

<style lang="scss" scoped>
.movie-boom {
  display: flex;
  align-items: center;
  padding-top: 16rpx;
  padding-bottom: 4rpx;
  background-color: #ffffff;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding-bottom: 50rpx;
  .movie-boom-item {
    width: 50%;
    text-align: center;
    image {
      width: 48rpx;
      height: 48rpx;
    }
    .boom-item-text {
      color: #a2a4aa;
      font-size: 20rpx;
    }
  }
}
</style>
